//package cn.itcast.gateway.config;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.cloud.gateway.filter.GlobalFilter;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.annotation.Order;
//import reactor.core.publisher.Mono;
//
///**
// * @author ：xiaoZhou
// * @ClassName : FilterConfiguration
// * @date ：Created in 2021/12/11 22:15
// */
//@Slf4j
//@Configuration
//public class FilterConfiguration {
//    @Bean
//    @Order(-2)
//    public GlobalFilter globalFilter1(){
//        return ((exchange, chain) -> {
//            System.out.println("过滤器1的pre阶段！");
//            return chain.filter(exchange).then(Mono.fromRunnable(() -> {
//                System.out.println("过滤器1的post阶段！");
//            }));
//        });
//    }
//
//    @Bean
//    @Order(-1)
//    public GlobalFilter globalFilter2(){
//        return ((exchange, chain) -> {
//            System.out.println("过滤器2的pre阶段！");
//            return chain.filter(exchange).then(Mono.fromRunnable(() -> {
//                System.out.println("过滤器2的post阶段！");
//            }));
//        });
//    }
//
//    @Bean
//    @Order(0)
//    public GlobalFilter globalFilter3(){
//        return ((exchange, chain) -> {
//            System.out.println("过滤器3的pre阶段！");
//            return chain.filter(exchange).then(Mono.fromRunnable(() -> {
//                System.out.println("过滤器3的post阶段！");
//            }));
//        });
//    }
//}
